package com.wen.springboot_db_20210510.service.impl;

import com.wen.springboot_db_20210510.beans.UserInfo;
import com.wen.springboot_db_20210510.dao.UserDao;
import com.wen.springboot_db_20210510.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    UserDao dao;

    @Override
    public UserInfo getUserById(int id) {
        return dao.getUserById(id);
    }

    @Override
    public UserInfo getUserByCardno(String cardno) {
        return dao.getUserByCardno(cardno);
    }

    @Override
    public int insertUser(String cardno, String psname) {
        return dao.insertUser(cardno, psname);
    }

    @Override
    public List<UserInfo> getAllUser() {
        return dao.getAllUser();
    }

    @Override
    public int deleteById(Integer id) {
        return dao.deleteById(id);
    }

    @Override
    public int updateUser(int id, String cardno, String psname) {
        return dao.updateUser(id, cardno, psname);
    }
}
